import Vue from 'vue';
import { message } from 'ant-design-vue';
import App from './App.vue';
import router from './router';
import store from './store';
import './plugins/ant-design-vue';
import '@/styles/reset.less';

// window上挂载
window.$message = message;

store.watch(
  () => store.getters['menuRoute/asyncRoutes'],
  (routes) => {
    routes.forEach((r) => router.addRoute(r));
  },
);
store.dispatch('loginInfo/whoAmI');

Vue.config.productionTip = false;

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount('#app');
